from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from config import ROLES

class SirogiUser(User):
    
    NIC = models.CharField(_('NIC'), max_length = 15, unique=True, help_text=_('Required. Add your NIC here, you can use letters, numbers and symbols.'))
    role = models.CharField(_('Role'), max_length=2, choices=ROLES, help_text=_('Select the role assigned to this user'))

    def is_SirogiManager(self):
        return self.role == u'M'

    def is_SirogiEditor(self):
        return self.role == u'E'

    def is_SirogiInspector(self):
        return self.role == u'I'

    def is_SirogiGuest(self):
        return self.role == u'G'
	
